﻿using PartyInvites.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace PartyInvites.Controllers
{
    public class AdminController
    {
        private IUserRepository respository;

        public AdminController(IUserRepository param)
        {
            respository = param;
        }

        public void ChangeLoginName(string oldName,string newName)
        {
            User user = respository.Get(oldName);
            user.LoginName = newName;
            respository.SaveChanges();
        }
    }
}